﻿/*
 * Erstellt mit SharpDevelop.
 * Benutzer: Kai Patrick
 * Datum: 01.04.2008
 * Zeit: 16:00
 * 
 * Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
 */

using System;
using System.Collections.Generic;
using System.Text;

using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Shell;
using Microsoft.Scripting.Generation;
using Microsoft.Scripting.Runtime;
using Microsoft.Scripting.Utils;

namespace Gamadus.Engine.Compiler.Runtime {
    public class DefaultOptionsParser : OptionsParser {
        private ConsoleOptions _consoleOptions;
        private EngineOptions _engineOptions;

        public override ConsoleOptions ConsoleOptions {
            get { return _consoleOptions; }
            set { _consoleOptions = value; }
        }
        public override EngineOptions EngineOptions {
            get { return _engineOptions; }
            set { _engineOptions = value; }
        }

        public DefaultOptionsParser(GmlLanguageContext context) : base(context) {
        }

        public override void Parse(string[] args) {
            if (_consoleOptions == null) _consoleOptions = GetDefaultConsoleOptions();
            if (_engineOptions == null) _engineOptions = GetDefaultEngineOptions();

            base.Parse(args);
        }

        /// <exception cref="Exception">On error.</exception>
        protected override void ParseArgument(string arg) {
            Contract.RequiresNotNull(arg, "arg");

            base.ParseArgument(arg);
        }
    }
}

